package com.fan.analysis.module.preprocessing.message.controller;

import com.fan.analysis.common.domain.ResponseDTO;
import com.fan.analysis.module.preprocessing.message.domain.vo.MessageInCompleteVo;
import com.fan.analysis.module.preprocessing.message.domain.vo.SpanMessageVo;
import com.fan.analysis.module.preprocessing.message.service.MessageService;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 短信记录控制器
 *
 * @author fan
 * @date 2021/09/20 12:56
 **/
@RestController
@Slf4j
public class MessageController {


    @Autowired
    private MessageService messageService;


    @ApiOperation("原始短信数据-短信数据导入 @author fan")
    @PostMapping(value = "/preprocessed/completing_message_data")
    public ResponseDTO<List<MessageInCompleteVo>> completingMessageData() {
        log.info("原始短信数据-短信数据导入");
        Integer number = 20;
        return messageService.completingMessageData(number);
    }

    @ApiOperation("原始短信数据-垃圾短信过滤 @author fan")
    @PostMapping(value = "/preprocessed/get_spam_message_data/{number}")
    public ResponseDTO<List<SpanMessageVo>> getSpamMessageData(@PathVariable("number") Integer number) {
        log.info("原始短信数据-垃圾短信过滤");
        return messageService.getSpamMessageData(number);
    }

}
